package lapsnake.model.expr;

import lapsnake.model.*;
import lapsnake.model.data.*;
import lapsnake.py.ast.ASTHelperFactory; import java.beans.PropertyVetoException;

import org.python.antlr.ast.*;

/**Wrapper class with helper functions for UnaryOp nodes*/
public class LapUnaryOp extends LapExpression {
	public final VetoableProperty<unaryopType> op = new VetoableProperty<>(unaryopType.class);
	public final SingleChild<LapExpression> operand = new SingleChild<>(this, LapExpression.class);
	
	public LapUnaryOp(PyAST pyAST, ChildField<? super LapUnaryOp> parent, UnaryOp node) throws PropertyVetoException {
		super(pyAST, parent, node);
		
		op.setInternal(node.getInternalOp());
		ASTHelperFactory.makeHelper(pyAST, operand, node.getInternalOperand());
		
		buildTextNodes(node);
	}
}
